<template>
  <view>
    <view style="background: #ffffff; border-radius: 16rpx; padding: 0 23rpx; margin: 20rpx 24rpx">
      <template v-for="item in options" :key="item.key">
        <view v-if="info[item.key] != null" class="dt-flex-1">
          <edit-item v-model="info" :option="item" />
        </view>
      </template>
    </view>

    <view style="height: 100rpx"></view>
  </view>
</template>
<script setup>
  import editItem from '@/com/editItem.vue'
  import { onLoad } from '@dcloudio/uni-app'
  import { reactive, ref } from 'vue'
  import mgr from './biz'
  const info = ref({})

  onLoad((opt) => {
    mgr.detail(opt.id).then((res) => {
      info.value = res
      if (res.status == 'NO_RECEIVE') receiveStatus.style = { color: '#f33c3c' }
    })
  })

  const receiveStatus = reactive({ key: 'receiveStatus', title: '客户状态', type: 'text' })

  const options = reactive([
    receiveStatus,
    { key: 'customerName', title: '客户名称', type: 'text' },
    { key: 'customerType', title: '客户类型', type: 'text' },
    { key: 'areaName', title: '客户所在地', type: 'text' },
    { key: 'wishArea', title: '求购区域', type: 'text' },
    { key: 'wishPrice', title: '求购总价范围', type: 'text' },
    { key: 'propertyType', title: '物业类型', type: 'text' },
    { key: 'coverArea', title: '占地面积(万㎡)', type: 'text' },
    { key: 'plotRatio', title: '容积率', type: 'text' },
    { key: 'canSaleArea', title: '总可售面积(㎡)', type: 'text' },
    { key: 'roomCount', title: '房间数量(个)', type: 'text' },
    { key: 'starStandard', title: '星级标准', type: 'text' },
    { key: 'otherRequire', title: '其他要求', type: 'text' }
  ])
</script>
<style lang="scss" scoped></style>
